// app.js

App({
  globalData: {
    statusBarHeight: 0,
    menuButtonHeight: 0,
    navigationBarAndStatusBarHeight: 0,
    navigationBarHeight:0,
  },

  onLaunch() {
    const {
      statusBarHeight,
      platform
    } = wx.getSystemInfoSync()
    const {
      top,
      height
    } = wx.getMenuButtonBoundingClientRect()

    // 判断胶囊按钮信息是否成功获取
    let navigationBarHeight = (top > 0 && height > 0) ? (top - statusBarHeight + height) : (platform === 'android' ? 48 : 40);
    this.globalData.navigationBarHeight=navigationBarHeight;
    this.globalData.statusBarHeight = statusBarHeight; // 状态栏高度
    this.globalData.menuButtonHeight = height ? height : 32; // 胶囊按钮高度 一般是32 如果获取不到就使用32
    this.globalData.navigationBarAndStatusBarHeight = statusBarHeight + navigationBarHeight;


    //+若缓存中有用户信息，应直接登录
  },

})